package svc

import (
	"github.com/zeromicro/go-zero/core/stores/sqlx"
	"hm-zero-mall/apps/address/models"
	"hm-zero-mall/apps/address/rpc/internal/config"
)

type ServiceContext struct {
	Config       config.Config
	AddressModel models.AddressModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:       c,
		AddressModel: models.NewAddressModel(sqlx.NewMysql(c.DB.DataSource), c.Cache),
	}
}
